<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>订产品，送75元话费</title>
  </head>
  <style>
    html,
    body {
      margin: 0;
      padding: 0;
      height: 100%;
      background-color: #0165e1;
      overflow-y: auto;
    }

    .page {
      background: url('./images/bg.png') no-repeat;
      background-size: 100%;
    }

    .content {
      padding-top: 154.133vw;
    }

    #dinggouButton {
      background: url('./images/button.png');
      height: 23.467vw;
      background-size: contain;
    }

    .rule-container {
      padding: 0 20px;
    }

    .rule {
      background: url('./images/rule.png') no-repeat;
      background-size: contain;
      height: 65.6vw;
    }

    .dialog-mask {
      position: fixed;
      top: 0;
      left: 0;
      z-index: 2;
      display: none;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
    }

    .dialog {
      position: absolute;
      top: 50%;
      left: 50%;
      z-index: 2;
      transform: translate(-50%, -50%);
      width: 80.667vw;
      height: 46.667vw;
      background: url('./images/tips.png') no-repeat;
      background-size: contain;
    }

    .dialog-close {
      position: absolute;
      bottom: -18.333vw;
      left: 50%;
      margin-left: -6.4vw;
      z-index: 4;
      background: url('./images/close.png') no-repeat;
      background-size: contain;
      width: 12vw;
      height: 12vw;
    }
  </style>
  <body>
    <div class="page">
      <div class="content">
        <div id="dinggouButton"></div>
        <div class="rule-container">
          <div class="rule"></div>
        </div>
      </div>
      <div class="dialog-mask">
        <div class="dialog">
          <div class="dialog-close"></div>
        </div>
      </div>
    </div>
    <script>
      var button = document.getElementById('dinggouButton');
      var dialog = document.querySelector('.dialog-mask');

      button.addEventListener('click', function () {
        dialog.style.display = 'block';
        var close = document.querySelector('.dialog-close');
        function closeFn() {
          dialog.style.display = 'none';
          close.removeEventListener('click', closeFn);
        }
        close.addEventListener('click', closeFn);
      });
    </script>
  </body>
</html>
